/**
 * 项目名：	Rumba Plan
 * 
 * 版权所有(C)，上海海鼎信息工程股份有限公司，2006，所有权利保留。
 * 
 * 文件名：	FVRumbaSystemCommon.java
 * 模块说明：	
 * 修改历史：
 * 2006-10-25 - lxm - 创建。
 */
package com.hd123.rumba.cartridge;

import net.sf.hibernate.HibernateException;

import com.hd123.rumba.action.log.ViewActionLog;
import com.hd123.rumba.cartridge.biz.BCartFunctionView;
import com.hd123.rumba.cartridge.entry.Entry;
import com.hd123.rumba.cartridge.entry.EntryLinkStyle;
import com.hd123.rumba.domain.IDomain;
import com.hd123.rumba.exception.BusinessException;
import com.hd123.rumba.log.CActionLog;
import com.hd123.rumba.navigation.menu.BMenu;
import com.hd123.rumba.user.IUser;

/**
 * 功能视图：系统管理（基础）
 * <p>
 * 
 * 标题：系统管理（基础）<br>
 * 前缀：RBSC<br>
 * 抽象：是<br>
 * 说明：提供关于域、组织、用户认证与授权等基础功能。<br>
 * 
 * @author lxm
 * 
 */
public class FVRumbaSystemCommon extends BCartFunctionView {

  public static final String FUNCV_PREFIX = "RBSC";

  @Override
  public boolean canLoadToDomain(IDomain domain) throws BusinessException, HibernateException {
    return true;
  }

  @Override
  public void onLoadToDomain(IDomain domain, IUser operator) throws BusinessException,
      HibernateException, InterruptedException {
    // Do Nothing
  }

  @Override
  public void onUnloadFromDomain(IDomain domain, IUser operator) throws BusinessException,
      HibernateException, InterruptedException {
    // Do Nothing
  }
  
  public static final String ID_ENTRY_WELCOME = "welcome";
  public static final String ID_ENTRY_HEADINGWWW = "heading_www";
  public static final String ID_ENTRY_LOG = "log";

  @Override
  protected void buildEntries() throws BusinessException {
    this.getEntries().clear();
    Entry e = null;
    
    e = this.appendEntry(ID_ENTRY_WELCOME, "");
    e.setPermissions(null);
    e.appendLink("ViewApplication?start=welcome");
    
    e = this.appendEntry(ID_ENTRY_HEADINGWWW, "www.hd123.com");
    e.setPermissions(null);
    e.appendLink("http://www.hd123.com", "_blank", EntryLinkStyle.simple);

    e = this.appendEntry("log", CActionLog.CAPTION_CLASS);
    e.setPermission(ViewActionLog.PERMISSION_VIEW);
    e.appendLink("log/ViewActionLog?start=list");
  }

  @Override
  protected void buildMainMenu(BMenu mainMenu) throws BusinessException {
    // Do Nothing
  }
}
